Blockchain-based recording and querying operations

ABSTRACT

Implementations of this specification provide blockchain-based recording and querying methods and apparatuses. An example method includes operations performed by an access gateway, including receiving, from a first service system, user data including a user identifier of a user; transmitting, to an identifier hash system, a first hash request for the user identifier; receiving, from the identifier hash system, a hash digest of the user identifier; replacing the user identifier in the user data with the hash digest of the user identifier, and packaging the user data into a storage transaction; transmitting, to a blockchain, the storage transaction; receiving, from the blockchain, a result of the storage transaction having been performed by a smart contract published by the first service system on the blockchain; and providing, to the first service system, the result of the storage transaction.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/776,272, filed on Jan. 29, 2020, which is a continuation of PCTApplication No. PCT/CN2020/072130, filed on Jan. 15, 2020, which claimspriority to Chinese Patent Application No. 201910348198.5, filed on Apr.28, 2019, and each application is hereby incorporated by reference inits entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate to the field of blockchaintechnology, and in particular, to blockchain-based credit recording andquerying methods, apparatuses, and an electronic device.

BACKGROUND

Blockchain technology, also known as distributed ledger technology, isan emerging technology in which several computing devices jointlyparticipate in “accounting” and maintain a complete distributeddatabase. Because the blockchain technology has the characteristics ofdecentralization, openness and transparency, participability of eachcomputing device in database records, and rapid data synchronizationbetween computing devices, the blockchain technology may be widely usedin many fields.

SUMMARY

The embodiments of the present disclosure provide blockchain-basedcredit recording and querying methods, apparatuses, and an electronicdevice.

According to a first aspect of some embodiments of the presentdisclosure, there is provided a blockchain-based credit recordingmethod, including: submitting, by a service system, user behavior datato an access gateway, wherein the user behavior data includes a useridentifier; transmitting, by the access gateway, a hash request for theuser identifier to an identifier hash system; in response to the hashrequest, performing, by the identifier hash system, a reversibleconversion on the user identifier based on a reversible conversionfunction, and a hash digest calculation on a converted user identifierto generate a hash digest; generating a check code for the hash digest,and returning, to the access gateway, the hash digest to which the checkcode is added; after the access gateway replaces the user identifier inthe user behavior data with the hash digest, packaging the user behaviordata into a behavior transaction, and transmitting the behaviortransaction to a node device on a blockchain; and in response to thebehavior transaction, invoking, by the node device, a credit scorecalculation logic declared in a smart contract corresponding to thebehavior transaction, and storing, in the blockchain, a credit scorecalculated based on the user behavior data.

According to a second aspect of some embodiments of the presentdisclosure, there is provided a blockchain-based credit querying method,including: transmitting, by a service system, a user credit queryingrequest to an access gateway, wherein the request includes a useridentifier; transmitting, by the access gateway, a hash request for theuser identifier to an identifier hash system; in response to the hashrequest, acquiring, by the identifier hash system, respective hashdigests related to the user identifier; packaging, by the accessgateway, the respective hash digests into a query transaction, andtransmitting the query transaction to a node device on a blockchain; inresponse to the query transaction, invoking, by the node device, acalculation logic declared in a smart contract corresponding to therespective hash digests in the query transaction, and calculating a sumof weighted credit scores corresponding to the respective hash digeststo acquire a total credit score; and returning the total credit score tothe access gateway, so that the access gateway returns the total creditscore to the service system.

According to a third aspect of some embodiments of the presentdisclosure, there is provided a blockchain-based credit recordingmethod, the method being applied to an access gateway, and including:acquiring behavior data of a target user submitted by a target servicesystem; and packaging the behavior data into a credential storagetransaction and transmitting the credential storage transaction to anode device on a blockchain, so that the node device, in response to thecredential storage transaction, invokes a calculation logic declared ina smart contract published by the target service system on theblockchain, calculates a credit score of the target user based on thebehavior data, and stores, as a credential, the credit score of thetarget user under the target service system.

According to a fourth aspect of some embodiments of the presentdisclosure, there is provided a blockchain-based credit recordingmethod, the method being applied to a node device on a blockchain, andincluding: receiving, from an access gateway, a credential storagetransaction into which behavior data of a target user submitted by atarget service system is packaged; and in response to the credentialstorage transaction, invoking a calculation logic declared in a smartcontract published by the target service system on the blockchain,calculating a credit score of the target user based on the behaviordata, and storing, as a credential, the credit score of the target userunder the target service system.

According to a fifth aspect of some embodiments of the presentdisclosure, there is provided a blockchain-based credit querying method,the method being applied to an access gateway, and including: receivinga credit score querying request with respect to a target user submittedby a target service system; submitting a query transaction with respectto the target user to a node device on a blockchain, so that the nodedevice, in response to the query transaction, invokes a calculationlogic declared in a smart contract published on the blockchain, searchesfor credit scores of the target user in respective service systems, andcalculates a total credit score according to the credit scores of thetarget user in the respective service systems; and returning, to thetarget service system, the total credit score of the target userincluded in a query result returned by the node device.

According to a sixth aspect of some embodiments of the presentdisclosure, there is provided a blockchain-based credit querying method,the method being applied to a node device on a blockchain, andincluding: receiving a query transaction with respect to a target usersubmitted by an access gateway; in response to the query transaction,invoking a calculation logic declared in a smart contract published onthe blockchain, searching for credit scores of the target user inrespective service systems, and calculating a total credit scoreaccording to the credit scores of the target user in the respectiveservice systems; and returning, to a target service system, the totalcredit score of the target user included in a query result returned bythe node device.

According to a seventh aspect of some embodiments of the presentdisclosure, there is provided a blockchain-based credit recordingapparatus, the apparatus being applied to an access gateway, andincluding: an acquisition unit configured to acquire behavior data of atarget user submitted by a target service system; and a recording unitconfigured to package the behavior data into a credential storagetransaction and transmit the credential storage transaction to a nodedevice on a blockchain, so that the node device, in response to thecredential storage transaction, invokes a calculation logic declared ina smart contract published by the target service system on theblockchain, calculates a credit score of the target user based on thebehavior data, and stores, as a credential, the credit score of thetarget user under the target service system.

According to an eighth aspect of some embodiments of the presentdisclosure, there is provided a blockchain-based credit recordingapparatus, the apparatus being applied to a node device on a blockchain,and including: a reception unit configured to receive, from an accessgateway, a credential storage transaction into which behavior data of atarget user submitted by a target service system is packaged; and arecording unit configured to, in response to the credential storagetransaction, invoke a calculation logic declared in a smart contractpublished by the target service system on the blockchain, calculate acredit score of the target user based on the behavior data, and store,as a credential, the credit score of the target user under the targetservice system.

According to a ninth aspect of some embodiments of the presentdisclosure, there is provided a blockchain-based credit queryingapparatus, the apparatus being applied to an access gateway, andincluding: a reception unit configured to receive a credit scorequerying request with respect to a target user submitted by a targetservice system; a querying unit configured to submit a query transactionwith respect to the target user to a node device on a blockchain, sothat the node device, in response to the query transaction, invokes acalculation logic declared in a smart contract published on theblockchain, searches for credit scores of the target user in respectiveservice systems, and calculates a total credit score according to thecredit scores of the target user in the respective service systems; anda returning unit configured to return, to the target service system, thetotal credit score of the target user included in a query resultreturned by the node device.

According to a tenth aspect of some embodiments of the presentdisclosure, there is provided a blockchain-based credit queryingapparatus, the apparatus being applied to a node device on a blockchain,and including: a reception unit configured to receive a querytransaction with respect to a target user submitted by an accessgateway; a querying unit configured to, in response to the querytransaction, invoke a calculation logic declared in a smart contractpublished on the blockchain, search for credit scores of the target userin respective service systems, and calculate a total credit scoreaccording to the credit scores of the target user in the respectiveservice systems; and a returning unit configured to return, to a targetservice system, the total credit score of the target user included in aquery result returned by the node device.

According to an eleventh aspect of some embodiments of the presentdisclosure, there is provided an electronic device, including: aprocessor; and a memory for storing processor executable instructions,wherein the processor is configured to implement a blockchain-basedcredit recording method according to any of the aspects described above.

According to a twelfth aspect of some embodiments of the presentdisclosure, there is provided an electronic device, including: aprocessor; and a memory for storing processor executable instructions,wherein the processor is configured to implement a blockchain-basedcredit querying method according to any of the aspects described above.

The embodiments of the present disclosure provide a blockchain-basedcredit recording solution. For the credential storage transaction of thetarget user submitted by the target service system, the node device onthe blockchain may invoke the calculation logic declared in the smartcontract published by the target service system on the blockchain,calculate the credit score of the target user based on the behaviordata, and store, as a credential, the credit score of the target userunder the target service system. Correspondingly, in a credit queryingsolution, for the credit score querying request with respect to thetarget user submitted by any of service systems, the node device on theblockchain may invoke the calculation logic declared in the smartcontract published on the blockchain, search for the credit scores ofthe target user in the respective service systems, and calculate thetotal credit score according to the credit scores of the target user inthe respective service systems. In this way, based on thecharacteristics of blockchain that cannot be tampered with and is openand transparent, the credit evaluation process for a user in variousservice systems will be made public and fair.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic flowchart illustrating a blockchain-based creditrecording method according to an embodiment of the present disclosure.

FIG. 2 is an example of a method in which a service system is taken asan entity, corresponding to that shown in FIG. 1.

FIG. 3 is an example of a method in which a node device on a blockchainis taken as an entity, corresponding to that shown in FIG. 1.

FIG. 4 is a schematic flowchart illustrating a blockchain-based creditquerying method according to an embodiment of the present disclosure.

FIG. 5 is an example of a method in which a service system is taken asan entity, corresponding to that shown in FIG. 4.

FIG. 6 is an example of a method in which a node device on a blockchainis taken as an entity, corresponding to that shown in FIG. 4.

FIG. 7 is a schematic modular diagram illustrating a blockchain-basedcredit recording apparatus according to an embodiment of the presentdisclosure.

FIG. 8 is a schematic modular diagram illustrating a blockchain-basedcredit recording apparatus according to an embodiment of the presentdisclosure.

FIG. 9 is a schematic modular diagram illustrating a blockchain-basedcredit querying apparatus according to an embodiment of the presentdisclosure.

FIG. 10 is a schematic modular diagram illustrating a blockchain-basedcredit querying apparatus according to an embodiment of the presentdisclosure.

DETAILED DESCRIPTION OF THE EMBODIMENTS

Examples will be described in detail herein, with the illustrationsthereof represented in the drawings. When the following descriptionsinvolve the drawings, like numerals in different drawings refer to likeor similar elements unless otherwise indicated. The embodimentsdescribed in the following examples do not represent all embodimentsconsistent with the present disclosure. Rather, they are merely examplesof apparatuses and methods consistent with some aspects of the presentdisclosure as detailed in the appended claims.

The terms used in the present disclosure are for the purpose ofdescribing particular examples only, and are not intended to limit thepresent disclosure. Terms determined by “a”, “the” and “said” in theirsingular forms in the present disclosure and the appended claims arealso intended to include plurality, unless clearly indicated otherwisein the context. It should also be understood that the term “and/or” asused herein refers to and includes any and all possible combinations ofone or more of the associated listed items.

It is to be understood that, although terms “first,” “second,” “third,”and the like may be used in the present disclosure to describe variousinformation, such information should not be limited to these terms.These terms are only used to distinguish one category of informationfrom another. For example, without departing from the scope of thepresent disclosure, first information may be referred as secondinformation. Similarly, second information may also be referred as firstinformation. Depending on the context, the word “if” as used herein maybe interpreted as “when” or “upon” or “in response to determining”.

With the continuous development of social economy, recording the creditof individuals or enterprises has become more important. Especially withthe vigorous development of sharing economy model, the sharing economymodel imposes a test on users' credit. At present, users' credit systemconstruction methods are mostly central privatization methods. Eachenterprise usually establishes a set of credit systems separately forits own use. The collected data is, as a core asset, may not bedisclosed to the public. Moreover, because user credit data cannot beshared, each enterprise may not recognize user credit provided by otherthird parties, which can exacerbate the motivation of the enterprise toestablish its own credit system. In some cases, there exists aphenomenon of “reinventing the wheel”, which leads to the waste of alarge amount of resources. Since all credit evaluation systems areprivate, the credit evaluation process may have the problem of being notopen and transparent.

Further, a user's credit evaluation is usually calculated based on theuser's behavior data. The user's behavior data is a social attribute andshould be shared as social resources to jointly promote social andeconomic development. However, another problem that the disclosure ofuser behavior data faces is user data privacy. If a user's credit needsto be disclosed, the user's behavior data will also need to be madepublic, but since the user's behavior data involves user privacy, thedisclosure thereof may cause invasion and illegal use of the userprivacy. Therefore, there is a need for an open and transparent creditrecording solution, and it is also required to ensure the user privacy.

In some embodiments of the present disclosure, a blockchain-based creditrecording solution is provided. For the credential storage transactionof the target user submitted by the target service system, the nodedevice on the blockchain may invoke the calculation logic declared inthe smart contract published by the target service system on theblockchain, calculate the credit score of the target user based on thebehavior data, and store, as a credential, the credit score of thetarget user under the target service system. Correspondingly, in acredit querying solution, for the credit score querying request withrespect to the target user submitted by any of service systems, the nodedevice on the blockchain may invoke the calculation logic declared inthe smart contract published on the blockchain, search for the creditscores of the target user in the respective service systems, andcalculate the total credit score according to the credit scores of thetarget user in the respective service systems. In this way, based on thecharacteristics of blockchain that cannot be tampered with and is openand transparent, the credit evaluation process for a user in variousservice systems will be made public and fair. In addition, it ispossible to hide the true identity of the user exposed in the userbehavior data by way of converting the user identifier into the hashdigest, thereby avoiding the leakage and invasion of user privacy data.Through the aggregated user credit data access mechanism, it is possibleto accurately and comprehensively search for a user's credit score,thereby avoiding the leakage of the user's original behavior data andthe guessing of his/her identity. Furthermore, the credit evaluationmechanism declared in the smart contract may be used to set weights fordifferent service systems to incentivize entering service systems toimprove data accuracy and cost-effectiveness (the higher the quality ofdata is provided, the higher the weight is set accordingly) and increasethe data value of this blockchain-based credit system on the whole.

The blockchain described in this disclosure may include a privateblockchain, a public blockchain, a consortium blockchain, etc., and isnot particularly limited in the disclosure.

For example, in a scenario, the blockchain may be a consortiumblockchain consisting of a platform party, an audit party, a notarialparty, a publicity party, etc. as consortium members. The operator ofthe consortium blockchain may rely on the consortium blockchain todeploy corresponding services. The platform party, audit party, notarialparty, publicity party, etc. as the consortium members described abovemay be used as a service node of the above-mentioned services. Eachservice node may publish service-related information generated by itselfor received in form of transaction in the consortium blockchain, andafter the transaction has been consensus-processed by consensus nodes onthe consortium blockchain, the information is stored in a distributeddatabase of the consortium blockchain to complete the “on-chain”credential storage of the transaction information.

It should be noted that the transaction described in this disclosurerefers to data created by a client of the blockchain and published inthe distributed database of the blockchain.

Transactions in the blockchain are usually divided into narrowtransactions and broad transactions. The narrow transaction refers to avalue transfer published by a user to the blockchain. For example, in atraditional Bitcoin blockchain network, transaction may be a banktransfer initiated by a user in the blockchain. The broad transactionrefers to service data with a business intention published by a user tothe blockchain. For example, the operator may build a consortiumblockchain based on actual business needs and rely on the consortiumblockchain to deploy some other types of online business that are notrelated to value transfer, such as a credential storage service, ananti-counterfeit verification service, etc. In this type of consortiumblockchain, transaction may be a service message or service request witha business intention published by a user in the consortium blockchain.

The client may include any type of upper-layer applications that useunderlying business data stored in the blockchain as data support toimplement specific service functions.

In blockchain technology, nodes in the blockchain usually rely oncorresponding smart contract to operate a block. For example, operationssuch as storage, modification, and deletion in the blockchain may relyon a smart contract. The smart contract may be a computer protocolintended to be deployed on a blockchain and applied to propagate, verifyor execute the contract in a digital manner. By declaring a servicelogic in a smart contract, corresponding operation may be performed. Thesmart contract allows trusted transactions without a third party. Thesetransactions are traceable and irreversible. Smart contracts may providesecurity superior to traditional contract methods and reduce othertransaction costs associated with the contracts. Generally, a smartcontract may be deployed locally on a blockchain node. When a node needsto perform an action, corresponding smart contract may be invoked. Thesmart contract is operated to execute the service logic declared in thesmart contract to get an execution result.

The platform party may perform system maintenance and data calculation.The audit party may be responsible for qualification examination andrecording of entering service systems and reviewing of smart contracts.The notarial party may be responsible for notarization and storage ofdata. The publicity party may be responsible for announcement of smartcontracts, credit data, etc. In the early days of consortium, nodes fromother platform parties may also participate and be responsible for datacalculation and persistence, etc.

The process of a service party entering a blockchain will be describedbelow.

The service party transmits an entering application transaction to aplatform party and submits qualification-related information.

The platform party packages the qualification-related information into atransaction and transmits the transaction to the blockchain to apply forentering.

The blockchain executes a smart contract for the entering applicationand notifies audit parties of performing entering examination.

The audit parties transmit audit results to the blockchain, and theblockchain executes the smart contract for the entering application, andsummarizes the audit results.

The blockchain notifies the platform party of the summarized auditresult, and the platform party notifies the service party of the result.

So far, the process of the service party entering the blockchain ends.

After passing through the examination, the service party may create asmart contract for credit calculation (hereinafter referred to as acredit contract) that conforms to its own business scenario according tothe smart contract standard, and transmit a credit contract creationapplication.

The platform party packages an application transaction of the creditcontract and transmits the packaged application transaction to theblockchain.

The blockchain notifies the audit parties and the platform party ofperforming contract examination.

The blockchain summarizes audit results and notifies the platform partyand the publicity party of the summarized audit result.

After the platform party receives the summarized audit result, ifpassing through the examination, it will transmit a smart contractcreation transaction to create corresponding smart contract.

The blockchain will calculate credit contract digests, and verifywhether the contract has been approved and is valid. After passingthrough the verification, it will be created.

After the credit contract is successfully created, it will be publicizedby the publicity party.

So far, the creation of the credit contract is completed.

In some embodiments of this disclosure, the service systems are providedwith a channel for chaining smart contracts for credit calculation thatconform to their own business scenarios. For the overall technicalsolution, through different credit contracts, user credit data may becreated multi-dimensionally and comprehensively to improve creditaccuracy and data value.

FIG. 1 is a flowchart illustrating a blockchain-based credit recordingmethod. The method may be applied to a system architecture including aservice system, a blockchain, an access gateway, and an identifier hashsystem.

In this example, in order to meet the on-chain credential storagerequirements of multiple service systems, an access gateway may beprovided to uniformly deploy the credential storage requests of theservice systems. The access gateway may interface with a plurality ofdifferent service systems and is associated with a blockchain. Theaccess gateway may be a node device on the blockchain. Each servicesystem may implement a user's credit record by following steps below.

1. A service system submits behavior data of a user to an accessgateway.

The behavior data includes a user identifier of the user.

2. The access gateway transmits a hash request for the user identifierto an identifier hash system.

3.1. The identifier hash system, in response to the hash request,performs a reversible conversion on the user identifier based on areversible conversion function

3.4. A hash digest calculation is performed on a converted useridentifier to generate a hash digest.

3.3. A check code is generated for the hash digest.

The identifier hash system generates the check code for the generatedhash digest to prevent the hash digest from being tampered with.

3.4. The hash digest to which the check code is added is returned to theaccess gateway.

4.1. The access gateway replaces the user identifier in the userbehavior data with the hash digest.

Here, the access gateway hides the true identity of the user exposed inthe user behavior data by way of converting the user identifier into thehash digest, thereby avoiding the leakage and invasion of user privacydata.

4.2. The user behavior data is packaged into a behavior transaction.

4.3. The behavior transaction is transmitted to a node device on ablockchain.

5. The node device, in response to the behavior transaction, invokes acredit score calculation logic declared in a smart contractcorresponding to the behavior transaction, and stores, in theblockchain, a credit score calculated based on the user behavior data.

Here, the smart contract on the blockchain is used to evaluate usercredit based on the user behavior data, which makes the evaluationprocess public and fair.

6.1. The node device returns a transaction result to the access gateway.

6.2. The access gateway provides the transaction result returned by thenode device to the service system.

In this way, a service system completes a user's credit recordingprocess.

Referring to FIG. 2, an example of a method in which an access gatewayis taken as an entity in the present disclosure will be described below.This example may correspond to that in FIG. 1. The method includes:

At step 210, behavior data of a target user submitted by a targetservice system is acquired.

At step 220, the behavior data is packaged into a credential storagetransaction and the credential storage transaction is transmitted to anode device on a blockchain. The node device, in response to thecredential storage transaction, invokes a calculation logic declared ina smart contract published by the target service system on theblockchain, calculates a credit score of the target user based on thebehavior data, and stores, as a credential, the credit score of thetarget user under the target service system.

In an example, the behavior data includes a user identifier of thetarget user. In this example, before packaging the behavior data intothe credential storage transaction and transmitting the credentialstorage transaction to the node device on the blockchain, the methodfurther includes: generating a corresponding hash digest according tothe user identifier. Packaging the behavior data into the credentialstorage transaction and transmitting the credential storage transactionto the node device on the blockchain includes: replacing the useridentifier in the behavior data with the hash digest, and packaging thebehavior data into the credential storage transaction and transmittingthe credential storage transaction to the node device on the blockchain.

In an example, generating the corresponding hash digest according to theuser identifier includes: transmitting a hash request for the useridentifier to an identifier hash system, so that the identifier hashsystem performs a hash digest calculation on the user identifier togenerate a hash digest.

In an example, performing the hash digest calculation on the useridentifier to generate the hash digest includes: performing a reversibleconversion on the user identifier based on a reversible conversionfunction; and performing the hash digest calculation on a converted useridentifier to generate the hash digest.

In an example, a check code is added to the hash digest.

Referring to FIG. 3, an example of a method in which a node device on ablockchain is taken as an entity in the present disclosure will bedescribed below. This example may correspond to that in FIG. 1. Themethod includes:

At step 310, a credential storage transaction into which behavior dataof a target user submitted by a target service system is packaged isreceived from an access gateway.

At step 320, in response to the credential storage transaction, acalculation logic declared in a smart contract published by the targetservice system on the blockchain is invoked, a credit score of thetarget user is calculated based on the behavior data, and the creditscore of the target user under the target service system is stored as acredential.

In an example, the behavior data includes a hash digest.

The hash digest is generated by performing a hash digest calculation ona user identifier of the target user.

In an example, performing the hash digest calculation on the useridentifier of the target user includes: performing a reversibleconversion on the user identifier based on a reversible conversionfunction; and performing the hash digest calculation on a converted useridentifier to generate the hash digest.

In an example, the hash digest is further added with a check code.

In summary, some embodiments of the present disclosure provide ablockchain-based credit recording solution. For the credential storagetransaction of the target user submitted by the target service system,the node device on the blockchain may invoke the calculation logicdeclared in the smart contract published by the target service system onthe blockchain, calculate the credit score of the target user based onthe behavior data, and store, as a credential, the credit score of thetarget user under the target service system.

In this way, based on the characteristics of blockchain that cannot betampered with and is open and transparent, the credit evaluation processfor a user in various service systems will be made public and fair. Inaddition, it is possible to hide the true identity of the user exposedin the user behavior data by way of converting the user identifier intothe hash digest, thereby avoiding the leakage and invasion of userprivacy data.

FIG. 4 is a flowchart illustrating a blockchain-based credit queryingmethod. The method may be applied to a system architecture including aservice system, a blockchain, an access gateway, and an identifier hashsystem. This method may be performed after the credit record shown inFIG. 1.

In this example, in order to meet the on-chain credential storagerequirements of multiple service systems, an access gateway may beprovided to uniformly deploy the credential storage requests of theservice systems. The access gateway may interface with a plurality ofdifferent service systems and is associated with a blockchain. Theaccess gateway may be a node device on the blockchain. Each servicesystem may implement a user's credit record by following steps below.

7. A service system transmits a user credit querying request to anaccess gateway.

Any of service systems, when needing to acquire the credit informationof a target user, may transmit a target user credit querying request tothe access gateway. The request includes a user identifier of the targetuser.

8. The access gateway transmits a hash request for the user identifierto an identifier hash system.

Because the target user may correspondingly have multiple credit scoresin different service systems, respective hash digests related to thetarget user may be acquired from the identifier hash system.

9. The identifier hash system, in response to the hash request, acquiresrespective hash digests related to the user identifier.

10. The access gateway packages the respective hash digests into a querytransaction, and transmits the query transaction to a node device on ablockchain.

11. The node device, in response to the query transaction, invokes acalculation logic declared in a smart contract corresponding to therespective hash digests in the query transaction, and calculates a sumof weighted credit scores corresponding to the respective hash digeststo acquire a total credit score.

12. The total credit score is returned to the node device, so that thenode device returns the total credit score to the service system.

Referring to FIG. 5, an example of a method in which an access gatewayis taken as an entity in the present disclosure will be described below.This example may correspond to that in FIG. 4. The method includes:

At step 410, a credit score querying request with respect to a targetuser submitted by a target service system is received.

At step 420, a query transaction with respect to the target user issubmitted to a node device on a blockchain. The node device, in responseto the query transaction, invokes a calculation logic declared in asmart contract published on the blockchain, searches for credit scoresof the target user in respective service systems, and calculates a totalcredit score according to the credit scores of the target user in therespective service systems.

At step 430, the total credit score of the target user included in aquery result returned by the node device is returned to the targetservice system.

In an example, the credit score querying request includes a useridentifier of the target user. In this example, before submitting thequery transaction with respect to the target user to the node device onthe blockchain, the method further includes: acquiring respective hashdigests related to the user identifier. Submitting the query transactionwith respect to the target user to the node device on the blockchainincludes: packaging the respective hash digests into the querytransaction and submitting the query transaction to the node device onthe blockchain. Querying the credit scores of the target user in therespective service systems includes: searching for credit scorescorresponding to the respective hash digests in the blockchain.

In an example, calculating the total credit score according to thecredit scores of the target user in the respective service systemsincludes: calculating a sum of the weighted credit scores of the targetuser in the respective service systems according to weights of therespective service systems to calculate a weighted total credit score.

Referring to FIG. 6, an example of a method in which a node device on ablockchain is taken as an entity in the present disclosure will bedescribed below. This example may correspond to that in FIG. 4. Themethod includes:

At step 510, a query transaction with respect to a target user submittedby an access gateway is received.

At step 520, in response to the query transaction, a calculation logicdeclared in a smart contract published on the blockchain is invoked,credit scores of the target user in respective service systems issearched for, and a total credit score is calculated according to thecredit scores of the target user in the respective service systems.

At step 530, the total credit score of the target user included in aquery result returned by the node device is returned to a target servicesystem.

In an example, the query transaction includes a hash digest. In thisexample, the hash digest is a hash value acquired by performing a hashcalculation on a user identifier of the target user. Querying the creditscores of the target user in the respective service systems includes:searching for credit scores corresponding to respective hash digests inthe blockchain.

In an example, calculating the total credit score according to thecredit scores of the target user in the respective service systemsincludes: calculating a sum of the weighted credit scores of the targetuser in the respective service systems according to weights of therespective service systems to calculate a weighted total credit score.

In summary, some embodiments of the present disclosure provide ablockchain-based credit querying solution. For the credit score queryingrequest with respect to the target user submitted by any of servicesystems, the node device on the blockchain may invoke the calculationlogic declared in the smart contract published on the blockchain, searchfor the credit scores of the target user in the respective servicesystems, and calculate the total credit score according to the creditscores of the target user in the respective service systems. In thisway, through the aggregated user credit data access mechanism, it ispossible to accurately and comprehensively query a user's credit score,thereby avoiding the leakage of the user's original behavior data andthe guessing of user's identity. Furthermore, the credit evaluationmechanism declared in the smart contract may be used to set weights fordifferent service systems to incentivize entering service systems toimprove data accuracy and cost-effectiveness (the higher the quality ofdata is provided, the higher the weight is set accordingly) and increasethe data value of this blockchain-based credit system on the whole.

Corresponding to the examples of the blockchain-based credit recordingand querying methods, this disclosure also provides examples ofblockchain-based credit recording and querying apparatuses. Theapparatus examples may be implemented by software or by hardware or by acombination of software and hardware. Taking software implementation asan example, as a logical apparatus, it is formed by a processor of adevice, where it is located, reading corresponding computer businessprogram instructions in a non-volatile memory into a memory forexecution. In terms of hardware, in addition to a processor, a networkinterface, a memory, and a non-volatile memory, the device where theapparatus is located in the examples may usually further include otherhardware according to the actual function of the blockchain-based creditrecord and query, which will not be described herein again.

FIG. 7 is a modular diagram illustrating a blockchain-based creditrecording apparatus according to an embodiment of the presentdisclosure. The apparatus corresponds to the example shown in FIG. 2.The apparatus includes: an acquisition unit 710 configured to acquirebehavior data of a target user submitted by a target service system; anda recording unit 720 configured to package the behavior data into acredential storage transaction and transmit the credential storagetransaction to a node device on a blockchain. The node device, inresponse to the credential storage transaction, invokes a calculationlogic declared in a smart contract published by the target servicesystem on the blockchain, calculates a credit score of the target userbased on the behavior data, and stores, as a credential, the creditscore of the target user under the target service system.

In some embodiments, the behavior data includes a user identifier of thetarget user.

The recording unit 720 includes: a generation subunit configured togenerate a corresponding hash digest according to the user identifier;and a transmission subunit configured to replace the user identifier inthe behavior data with the hash digest, and package the behavior datainto the credential storage transaction and transmit the credentialstorage transaction to the node device on the blockchain.

In some embodiments, the generation subunit is configured to: transmit ahash request for the user identifier to an identifier hash system, sothat the identifier hash system performs a hash digest calculation onthe user identifier to generate a hash digest.

In some embodiments, performing the hash digest calculation on the useridentifier to generate the hash digest includes: performing a reversibleconversion on the user identifier based on a reversible conversionfunction; and performing the hash digest calculation on a converted useridentifier to generate the hash digest.

In some embodiments, a check code is added to the hash digest.

FIG. 8 is a modular diagram illustrating a blockchain-based creditrecording apparatus according to an embodiment of the presentdisclosure. The apparatus corresponds to the example shown in FIG. 3.The apparatus includes: a reception unit 810 configured to receive, froman access gateway, a credential storage transaction into which behaviordata of a target user submitted by a target service system is packaged;and a recording unit 820 configured to, in response to the credentialstorage transaction, invoke a calculation logic declared in a smartcontract published by the target service system on the blockchain,calculate a credit score of the target user based on the behavior data,and store, as a credential the credit, score of the target user underthe target service system.

In some embodiments, the behavior data includes a hash digest.

The hash digest is generated by performing a hash digest calculation ona user identifier of the target user.

In some embodiments, performing the hash digest calculation on the useridentifier of the target user includes: performing a reversibleconversion on the user identifier based on a reversible conversionfunction; and performing the hash digest calculation on a converted useridentifier to generate the hash digest.

In some embodiments, the hash digest is further added with a check code.

FIG. 9 is a modular diagram illustrating a blockchain-based creditquerying apparatus according to an embodiment of the present disclosure.The apparatus corresponds to the example shown in FIG. 5. The apparatusincludes: a reception unit 910 configured to receive a credit scorequerying request with respect to a target user submitted by a targetservice system; a querying unit 920 configured to submit a querytransaction with respect to the target user to a node device on ablockchain, so that the node device, in response to the querytransaction, invokes a calculation logic declared in a smart contractpublished on the blockchain, searches for credit scores of the targetuser in respective service systems, and calculates a total credit scoreaccording to the credit scores of the target user in the respectiveservice systems; and a returning unit 930 configured to return, to thetarget service system, the total credit score of the target userincluded in a query result returned by the node device.

In some embodiments, the credit score querying request includes a useridentifier of the target user.

Before the querying unit 920, the apparatus further includes: anacquisition subunit configured to acquire respective hash digestsrelated to the user identifier.

Submitting, by the querying unit 920, the query transaction with respectto the target user to the node device on the blockchain includes:packaging the respective hash digests into the query transaction andsubmitting the query transaction to the node device on the blockchain.

Querying the credit scores of the target user in the respective servicesystems includes: searching for credit scores corresponding to therespective hash digests in the blockchain.

In some embodiments, calculating the total credit score according to thecredit scores of the target user in the respective service systemsincludes: calculating a sum of the weighted credit scores of the targetuser in the respective service systems according to weights of therespective service systems to calculate a weighted total credit score.

FIG. 10 is a modular diagram illustrating a blockchain-based creditquerying apparatus according to an embodiment of the present disclosure.The apparatus corresponds to the example shown in FIG. 6. The apparatusincludes: a reception unit 1010 configured to receive a querytransaction with respect to a target user submitted by an accessgateway; a querying unit 1020 configured to, in response to the querytransaction, invoke a calculation logic declared in a smart contractpublished on the blockchain, search for credit scores of the target userin respective service systems, and calculate a total credit scoreaccording to the credit scores of the target user in the respectiveservice systems; and a returning unit 1030 configured to return, to atarget service system, the total credit score of the target userincluded in a query result returned by the node device.

In some embodiments, the query transaction includes a hash digest.

The hash digest is a hash value acquired by performing a hashcalculation on a user identifier of the target user.

Querying the credit scores of the target user in the respective servicesystems includes: searching for credit scores corresponding torespective hash digests in the blockchain.

In some embodiments, calculating the total credit score according to thecredit scores of the target user in the respective service systemsincludes: calculating a sum of the weighted credit scores of the targetuser in the respective service systems according to weights of therespective service systems to calculate a weighted total credit score.

The system, apparatus, module, or unit illustrated in the above examplesmay be implemented by using a computer chip or an entity, or by using aproduct having a certain function. An implementation device can be acomputer, and the form of the computer may be a personal computer, alaptop computer, a cellular phone, a camera phone, a smartphone, apersonal digital assistant, a media player, a navigation device, anemail receiving and sending device, a game console, a tablet computer, awearable device, or any combination of these devices.

For details about the implementation process of functions and roles ofunits in the above apparatuses, reference may be made to theimplementation process of corresponding steps in the above methods,which will not be described herein again.

For the apparatus examples, since they basically correspond to themethod examples, reference may be made to the partial description of themethod examples. The apparatus examples described above are merelyillustrative, wherein the units described as separate components may ormay not be physically separated, and the components displayed as unitsmay or may not be physical units, i.e., may be located in one place ormay be distributed to multiple network units. Some or all of the modulesmay be selected according to actual needs to achieve the objectives ofsolutions in the present disclosure. Those of ordinary skill in the artcan understand and implement the present disclosure without any creativeeffort.

The above figures describe the internal functional modules and structureof a blockchain-based credit recording or querying apparatus, and itsactual execution subject may be an electronic device, including: aprocessor; and a memory for storing processor executable instructions,wherein the processor is configured to: implement any of theblockchain-based credit recording or querying methods described above.

In examples of the electronic device, it should be understood that theprocessor may be a Central Processing Unit (CPU), or othergeneral-purpose processor, a Digital Signal Processor (DSP), anApplication Specific Integrated Circuit (ASIC), etc. The general-purposeprocessor may be a microprocessor or the processor may be anyconventional processor and the like. The aforementioned memory may be aread-only memory (ROM), a Random access memory (RAM), a flash memory, ahard disk, or a solid state disk. The steps of the method disclosed incombination with the examples of the present disclosure may be directlyperformed by a hardware processor, or may be performed by a combinationof hardware and software modules in a processor.

The examples in this disclosure are described in a progressive manner,and the same or similar parts between the examples may refer to eachother. Each example focuses on differences from other examples. Inparticular, with respect to the examples of the electronic device, sincethey are basically similar to the method examples, the descriptionthereof is relatively simple. For the related parts, reference may bemade to the description of the method examples.

Other embodiments of the present disclosure will be readily apparent tothose skilled in the art after considering the disclosure and practicingthe methods as disclosed herein. The present disclosure is intended tocover any variations, uses, or adaptations of the present disclosure,which follow the general principle of the present disclosure and includecommon knowledge or conventional technical means in the art that are notdisclosed in the present disclosure. The disclosure and examples are tobe regarded as illustrative only. The true scope and spirit of thepresent disclosure are pointed out by the following claims.

It is to be understood that the present disclosure is not limited to theprecise structures that have described and shown in the drawings, andvarious modifications and changes can be made without departing from thescope thereof. The scope of the disclosure is to be limited only by theappended claims.

1.-20. (canceled)
 21. A method comprising: receiving, by a node device of a blockchain and from an access gateway, a storage transaction including user data of a target user, the user data having been provided by a first service system; in response to receiving the storage transaction, (i) invoking, by the node device, a first calculation logic declared in a first smart contract published by the first service system on the blockchain, (ii) calculating a user score of the target user based on the user data, and (iii) storing the user score of the target user in association with the first service system; receiving, by the node device of the blockchain and from the access gateway, a query transaction, the query transaction being based on a user data query provided by a second service system; in response to receiving the query transaction, (i) invoking, by the node device, a second calculation logic declared in a second smart contract published on the blockchain, (ii) searching the blockchain for respective user scores of the target user stored in association with respective different service systems, (iii) calculating an aggregated user score of the target user, according to the respective user scores of the target user; and providing, by the node device of the blockchain and to the access gateway, the aggregated user score of the target user.
 22. The method according to claim 21, wherein the user data comprises a hash digest, and wherein the hash digest is generated by performing a hash digest calculation on a user identifier of the target user.
 23. The method according to claim 22, wherein performing the hash digest calculation on the user identifier of the target user comprises: performing a reversible conversion on the user identifier based on a reversible conversion function; and performing the hash digest calculation on a converted user identifier to generate the hash digest.
 24. The method according to claim 22, further comprising: adding a check code to the hash digest.
 25. The method according to claim 21, wherein the query transaction comprises a hash digest, and wherein the hash digest is a hash value acquired by performing a hash calculation on a user identifier of the target user, and wherein searching the blockchain for respective user scores of the target user comprises searching for user scores corresponding to respective hash digests in the blockchain.
 26. The method according to claim 21, wherein calculating the aggregated user score for the target user comprises aggregating weighted user scores of the target user, the weighted user scores being set according to weights of the respective different service systems.
 27. A computer-implemented system, comprising: one or more computers; and one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform operations comprising: receiving, by a node device of a blockchain and from an access gateway, a storage transaction including user data of a target user, the user data having been provided by a first service system; in response to receiving the storage transaction, (i) invoking, by the node device, a first calculation logic declared in a first smart contract published by the first service system on the blockchain, (ii) calculating a user score of the target user based on the user data, and (iii) storing the user score of the target user in association with the first service system; receiving, by the node device of the blockchain and from the access gateway, a query transaction, the query transaction being based on a user data query provided by a second service system; in response to receiving the query transaction, (i) invoking, by the node device, a second calculation logic declared in a second smart contract published on the blockchain, (ii) searching the blockchain for respective user scores of the target user stored in association with respective different service systems, (iii) calculating an aggregated user score of the target user, according to the respective user scores of the target user; and providing, by the node device of the blockchain and to the access gateway, the aggregated user score of the target user.
 28. The system according to claim 27, wherein the user data comprises a hash digest, and wherein the hash digest is generated by performing a hash digest calculation on a user identifier of the target user.
 29. The system according to claim 28, wherein performing the hash digest calculation on the user identifier of the target user comprises: performing a reversible conversion on the user identifier based on a reversible conversion function; and performing the hash digest calculation on a converted user identifier to generate the hash digest.
 30. The system according to claim 28, the operations further comprising: adding a check code to the hash digest.
 31. The system according to claim 27, wherein the query transaction comprises a hash digest, and wherein the hash digest is a hash value acquired by performing a hash calculation on a user identifier of the target user, and wherein searching the blockchain for respective user scores of the target user comprises searching for user scores corresponding to respective hash digests in the blockchain.
 32. The system according to claim 27, wherein calculating the aggregated user score for the target user comprises aggregating weighted user scores of the target user, the weighted user scores being set according to weights of the respective different service systems.
 33. A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising: receiving, by a node device of a blockchain and from an access gateway, a storage transaction including user data of a target user, the user data having been provided by a first service system; in response to receiving the storage transaction, (i) invoking, by the node device, a first calculation logic declared in a first smart contract published by the first service system on the blockchain, (ii) calculating a user score of the target user based on the user data, and (iii) storing the user score of the target user in association with the first service system; receiving, by the node device of the blockchain and from the access gateway, a query transaction, the query transaction being based on a user data query provided by a second service system; in response to receiving the query transaction, (i) invoking, by the node device, a second calculation logic declared in a second smart contract published on the blockchain, (ii) searching the blockchain for respective user scores of the target user stored in association with respective different service systems, (iii) calculating an aggregated user score of the target user, according to the respective user scores of the target user; and providing, by the node device of the blockchain and to the access gateway, the aggregated user score of the target user.
 34. The computer-readable medium according to claim 33, wherein the user data comprises a hash digest, and wherein the hash digest is generated by performing a hash digest calculation on a user identifier of the target user.
 35. The computer-readable medium according to claim 34, wherein performing the hash digest calculation on the user identifier of the target user comprises: performing a reversible conversion on the user identifier based on a reversible conversion function; and performing the hash digest calculation on a converted user identifier to generate the hash digest.
 36. The computer-readable medium according to claim 34, the operations further comprising: adding a check code to the hash digest.
 37. The computer-readable medium according to claim 33, wherein the query transaction comprises a hash digest, and wherein the hash digest is a hash value acquired by performing a hash calculation on a user identifier of the target user, and wherein searching the blockchain for respective user scores of the target user comprises searching for user scores corresponding to respective hash digests in the blockchain.
 38. The computer-readable medium according to claim 33, wherein calculating the aggregated user score for the target user comprises aggregating weighted user scores of the target user, the weighted user scores being set according to weights of the respective different service systems. 